// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: 'menu.home' },
    redirect: '/analysis',
    children: [
	{
		path: '/analysis',
		name: 'Analysis',
		component: () => import('@/views/dashboard/Analysis'),
		meta: { title: '数据分析', icon:bxAnaalyse, keepAlive: false }
	},
	{
	  path: '/account',
	  name: 'Account',
	  component: () => import('@/views/account'),
	  meta: { title: '用户管理', keepAlive: true, icon: 'user' ,permission: ['admin'] }
	},
	{
	  path: '/role',
	  name: 'Role',
	  component: () => import('@/views/role'),
	  meta: { title: '角色管理', keepAlive: true, icon: 'solution' ,permission: ['admin'] }
	},
	{
	  path: '/info',
	  name: 'UserInfo',
	  component: () => import('@/views/account/UserInfo'),
	  meta: { title: '个人信息维护', keepAlive: true, icon: 'solution'  }
	},
	{
	  path: '/company',
	  name: 'CompanyInfo',
	  component: () => import('@/views/account/CompanyInfo'),
	  meta: { title: '公司信息维护', keepAlive: true, icon: 'solution', permission: ['company']  }
	},
	{
	  path: '/notice',
	  name: 'Notice',
	  component: () => import('@/views/notice'),
	  meta: { title: '发布公告', keepAlive: true, icon: 'solution', permission: ['teacher']  }
	},
	{
	  path: '/recruit',
	  name: 'Recruit',
	  component: () => import('@/views/recruit'),
	  meta: { title: '发布招聘', keepAlive: true, icon: 'solution', permission: ['company']  }
	},
	{
	  path: '/review',
	  name: 'Review',
	  component: () => import('@/views/review'),
	  meta: { title: '招聘审核', keepAlive: true, icon: 'solution', permission: ['teacher']  }
	},
	{
	  path: '/home',
	  name: 'Home',
	  component: () => import('@/views/home'),
	  meta: { title: '首页', keepAlive: true, icon: 'solution' }
	},
	{
	  path: '/notice/:id',
	  name: 'NoticeDetail',
	  component: () => import('@/views/notice/detail'),
	  hidden: true
	},
	{
	  path: '/recruit/:id',
	  name: 'RecruitDetail',
	  component: () => import('@/views/recruit/detail'),
	  hidden: true
	},
	{
	  path: '/resume',
	  name: 'Resume',
	  component: () => import('@/views/resume'),
	  meta: { title: '我的简历', keepAlive: true, icon: 'solution', permission: ['student']  }
	},
	{
	  path: '/apply',
	  name: 'Apply',
	  component: () => import('@/views/apply'),
	  meta: { title: '我的投递', keepAlive: true, icon: 'solution', permission: ['student']  }
	},
	{
	  path: '/offer',
	  name: 'Offer',
	  component: () => import('@/views/offer'),
	  meta: { title: '我的Offer', keepAlive: true, icon: 'solution', permission: ['student']  }
	},
	{
	  path: '/audit',
	  name: 'Audit',
	  component: () => import('@/views/audit'),
	  meta: { title: '应聘审核', keepAlive: true, icon: 'solution', permission: ['company']  }
	},
	{
	  path: '/offer-manage',
	  name: 'OfferManage',
	  component: () => import('@/views/offerManage'),
	  meta: { title: '管理Offer', keepAlive: true, icon: 'solution', permission: ['company']  }
	},
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
